/*
 * @Author: early-autumn
 * @Date: 2020-05-06 16:09:57
 * @LastEditors: early-autumn
 * @LastEditTime: 2020-05-06 16:15:46
 */
import {
  getTodayStartWithEnd,
  getYesterdayStartWithEnd,
  getThisWeekStartWithEnd,
  getThisMonthStartWithEnd,
  getLastMonthStartWithEnd,
} from '@/common/getDate'

const todayStartWithEnd = getTodayStartWithEnd()
const yesterdayStartWithEnd = getYesterdayStartWithEnd()
const thisWeekStartWithEnd = getThisWeekStartWithEnd()
const thisMonthStartWithEnd = getThisMonthStartWithEnd()
const lastMonthStartWithEnd = getLastMonthStartWithEnd()

export const dateMap = {
  今日: todayStartWithEnd,
  昨日: yesterdayStartWithEnd,
  本周: thisWeekStartWithEnd,
  本月: thisMonthStartWithEnd,
  同比: lastMonthStartWithEnd,
}

export const dateOptions = Object.keys(dateMap).map((key) => ({
  label: key,
  value: key,
}))
